#include "stdafx.h"
#include "ObstacleManager\ObstacleManager.h"
#include "entity\Obstacle.h"
#include "entity\typeObstacle.h"

TEST(ObstaclManagerTest, mapSizeFor1VectorWith1Obstacle)
{
	EXPECT_EQ(ObstacleManager::getInstance().getMapSize(), 0);
	ObstacleManager::getInstance().getObstacle(typeObstacle::CROUCH, "la3");
	EXPECT_EQ(ObstacleManager::getInstance().getMapSize(), 1);
}


TEST(ObstacleManagerTest, mapSizeFor1VectorWith2Obstacles)
{
	ObstacleManager::getInstance().getObstacle(typeObstacle::CROUCH, "la3");
	EXPECT_EQ(ObstacleManager::getInstance().getMapSize(), 1);
}


TEST(ObstacleManagerTest, mapSizeFor2Vectors)
{
	ObstacleManager::getInstance().getObstacle(typeObstacle::JUMP, "la3");
	EXPECT_EQ(ObstacleManager::getInstance().getMapSize(), 2);
}

TEST(ObstacleManagerTest, VectorSizewith2Obstacles)
{	
	EXPECT_EQ(ObstacleManager::getInstance().getVectorSize(typeObstacle::JUMP), 1);
}
TEST(ObstacleManagerTest, VectorsizeIfWeCallAInactiveObstacle)
{
	EXPECT_EQ(ObstacleManager::getInstance().getVectorSize(typeObstacle::CROUCH), 2);
	ObstacleManager::getInstance().getVectorFirstElement(typeObstacle::CROUCH)->setActive(false);
	ObstacleManager::getInstance().getObstacle(typeObstacle::CROUCH, "la3");
	EXPECT_EQ(ObstacleManager::getInstance().getVectorSize(typeObstacle::CROUCH), 2);
	ObstacleManager::getInstance().getObstacle(typeObstacle::CROUCH, "la3");
	EXPECT_EQ(ObstacleManager::getInstance().getVectorSize(typeObstacle::CROUCH), 3);


}